---
title: In-Memory Storage for Workflows
sidebarTitle: Workflow
---

Example using `InMemoryDb` with workflows for multi-step processes.

## Usage

```python
from agno.agent import Agent
from agno.db.in_memory import InMemoryDb
from agno.models.openai import OpenAIChat
from agno.team import Team
from agno.tools.duckduckgo import DuckDuckGoTools
from agno.tools.hackernews import HackerNewsTools
from agno.workflow.step import Step
from agno.workflow.workflow import Workflow

# Setup in-memory database
db = InMemoryDb()

# Create agents and team
research_agent = Agent(
    name="Research Agent",
    model=OpenAIChat("gpt-5-mini"),
    tools=[HackerNewsTools(), DuckDuckGoTools()],
)

content_agent = Agent(
    name="Content Agent",
    model=OpenAIChat("gpt-5-mini"),
)

# Define workflow steps
research_step = Step(name="Research", agent=research_agent)
content_step = Step(name="Content", agent=content_agent)

# Create workflow
workflow = Workflow(
    name="Content Workflow",
    db=db,
    steps=[research_step, content_step],
)

workflow.print_response("AI trends in 2024")
```



## Developer Resources

- View [Cookbook](https://github.com/agno-agi/agno/blob/main/cookbook/db/in_memory/in_memory_storage_for_workflow.py)